#include<stdio.h>
#include<string.h>
#include<unistd.h>
#include<fcntl.h>
#include<sys/types.h>
#include<sys/stat.h>
/*
int main()
{
    int fd =open("log.txt",O_RDWR|O_APPEND);
    const char*str="linux\n";
    dup2(fd,1); 
    fprintf(stdout,str);
    write(1,str,6);
    write(3,str,6);
    printf("%d\n",fd);
    sleep(1);
    return 0;
}
*/




#define filename "log.txt"

int main()
{
    fprintf(stdout,"hello normal message\n");
    fprintf(stdout,"hello normal message\n");
    fprintf(stdout,"hello normal message\n");
    fprintf(stdout,"hello normal message\n");
    fprintf(stdout,"hello normal message\n");
 
    fprintf(stderr,"hello error message\n");
    fprintf(stderr,"hello error message\n");
    fprintf(stderr,"hello error message\n");
    fprintf(stderr,"hello error message\n");
    fprintf(stderr,"hello error message\n");
    return 0;
}







